home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Audio / Patchmix / XWindowsSource / nutree.h < prev    next >
C/C++ Source or Header  |  1992-03-28  |  874b  |  41 lines

  1. /*  $Header: nutree.h,v 1.1 90/08/27 17:11:04 mara Exp $" 
  2.  *
  3.  *  nutree.h
  4.  *
  5.  *  Written by Mara Helmuth
  6.  *
  7.  *  Description: Tree class for Cmix X graphical interface
  8.  * 
  9.  *  $Log:    nutree.h,v $
  10.  * Revision 1.1  90/08/27  17:11:04  mara
  11.  * Initial revision
  12.  * 
  13.  * 
  14.  */
  15.  
  16. class t_node {
  17.     friend class tree;
  18.     private:
  19.         t_node *lastchild;
  20.         list nodelist;  // list of input ugens 
  21.         int contents;    // ugen # this node represents
  22.         int index;    // number in nodelist currently on
  23.     t_node() : nodelist(sizeof(t_node)) { index = 0; };
  24. };
  25.  
  26. // tree stores indexes to ugen array
  27. class tree {
  28.     private:
  29.         t_node* root;
  30.         int size;
  31.         getinputtype get_left, get_right;
  32.     public:
  33.         tree(int s, int out_ugen); 
  34.         void insert(t_node* parent);
  35.         t_node* get_child(t_node* parent);
  36.         t_node* return_root() { return root; };
  37.         void clear(t_node* n = 0,int first = 1);
  38.         ~tree() { clear(); };
  39. };
  40.  
  41.